Guided Demonstration of Oberon/F for Mac OS, Release 1.1.
This Tour
This text is a brief introduction to Oberon/F. Read it and follow the small hands
on examples to get a feeling for the concepts and working model of Oberon/F.
Oberon/F
Oberon/F is an integrated cross
platform development system for the language Oberon. Currently, versions for Mac OS System 7 and Windows 3.1/NT 3.1 are available; other versions are planned. Oberon/F fully exploits the platform-specific user interface. Access to the underlying platform is possible, but can be isolated into special low-level modules. All modules relying on portable interfaces only, which includes most of the Oberon/F services, are fully portable, and still adopt the platform
specific look-and-feel.
The development environment for Oberon/F is identical with the production run
time environment of Oberon/F, enabling rapid development (RAD). The language Oberon is statically type
checked, fully type-safe, and garbage collected. Being a direct descendant of Pascal and Modula
2, it is easy to learn and to teach, programs are legible, and various programming paradigms, including object
oriented programming, are easily expressed. Oberon is simple enough to serve as a scripting language, yet powerful enough to enable system
level programming: Oberon/F itself is entirely written in Oberon. The Oberon compiler produces fast, native, 32-bit code. The system uses dynamic linking to completely avoid explicit linking steps in the development cycle.
Oberon/F is a fully extensible open framework. New subsystems, at equal footing with the standard text, form, and development subsystems, can be added freely and easily. Existing subsystems can be extended to accommodate new needs. Still, traditional fully linked double
clickable applications can be created as well.
Oberon/F is based on a compound document model. This document model and the supporting component framework architecture is proprietary, but designed in order to be easily integrated with OLE 2.0 and OpenDoc. Support for these industry standards is planned for a later release of Oberon/F.
Embedded document parts can be edited and resized in place. This demo text contains several embedded parts. Here is a first one: A non
portable picture view (without editing capabilities); it can be resized by first clicking into the picture and then dragging the displayed resize handles. Resizing constraints are resolved on the fly: In the example, the picture view always stays in proportion.
A picture view as an example of an
embedded document part
(picture of the Oberon moon)
The Oberon/F framework supports drag & drop editing (integration with the finder "clippings" mechanism is not yet available). To copy, hold down the option key when starting to drag.
An embedded object can be edited as a part of the embedding text. To avoid focusing an embedded part when trying to select it as a whole, hold down the command key while clicking into the part. (When clicking into a part while holding down the shift key in order to extend a selection, focusing is also disabled.)
Almost all operations in Oberon/F are subject to a multi
level undo/redo feature. (In fact, the framework makes it so easy to program something in an undoable fashion that it is almost more involved not to do so.)
Program Development
The following embedded part is a fully editable text, showing the complete source of a small Oberon module. To compile the module, focus the embedded part by clicking into it (e.g. click on the keyword PROCEDURE), and then execute Compile from menu Dev.
ObxHello0 is a minimal "hello world" program in Oberon. It writes a single line to the system log text. Execute Open
Log from menu Info to display the system log, if it isn't open already.
Exported items in Oberon modules are marked by a trailing asterisk; there are no separate header files, definition modules, or the like. Consistency of interfaces and implementations is fully checked by the compiler; version integrity is checked by the dynamic linker.
Module ObxHello0 exports a single command Do. Commands are Oberon procedures to be called by the user; i.e. they can be executed directly from the user interface. There is no need for a top
level module or a "main" procedure. A command can be added to a menu, attached to a button, or executed directly from within a text. To do the latter, the name of the command must be preceded by the name of the implementing module:
ObxHello0.Do
To execute a command by name, simply select the command string and execute Execute from menu Dev. Another possibility is to precede the command name with a special embedded part, called a commander
that can be inserted anywhere into a text using Insert
Commander from menu Tools. Clicking on a commander executes the appropriate command.
If the source contains errors detectable by the compiler, these are flagged directly in the text. For example, the following module version erroneously imports the (non
existing) module Outo, instead of Out. Try to compile the module - the compiler inserts special embedded parts, error markers, flagging the errors that it found. (The compiler also writes a report to the system log.)
By clicking on an error marker, it is expanded to display a short error message. Correct the mistake (delete the superfluous o in IMPORT Outo), and compile again. The marker disappears, and the module is compiled successfully.
The set of currently loaded modules can be inspected using Loaded
Modules from menu Info. The interfaces of modules (loaded or not) can be displayed using the browser: Select a module name and execute Interface from menu Info.
A module remains loaded until it is explicitly unloaded, or until the system is restarted. To unload a module, select the module name and execute Unload
Module
List from menu Dev. For example, unload ObxHello0, modify the string "Hello world", recompile ObxHello0, and activate ObxHello0.Do again. Note that your changes do not affect the running system until after you have unloaded the old module. Such an explicit unloading is a very useful mechanism to allow major changes in multiple modules, while still using and working with the previous version. (Consider editing the Oberon/F system editor with itself...)
Linking Programs to Forms
Besides the text and programming subsystems, the standard Oberon/F configuration also comes with a form subsystem, including a visual designer. Forms are e.g. data entry masks or dialog boxes.
The following module defines a simple record variable to be used for a data entry form.
After compiling the module, a dialog box can be created for the variable ObxAdr.adr using command New
Form... from menu Dev. Just enter the name of the exported global variable ObxAdr.adr into the link field, and click on the Create button. The type information extracted by the compiler is available to Oberon/F at run-time, which is used to automatically create a data-entry window for the form, with a simple default layout.
The created layout can be edited, and then opened as a dialog using the Open as Aux Dialog command in menu Dev.
The text entry fields and the checkbox are directly linked to the fields name, email, and getsUpdates of the variable ObxAdr.adr. The button is linked to the field Text, a procedure variable initialized to refer to procedure Text in module ObxAdr. Clicking the button causes procedure Text to be called. In turn, a new text is created, a report based on the variable adr is written to the text, a new text view is created, and used to open a window displaying the report. Next, the dialog variable is cleared and the system is notified that the variable has changed, causing the form's display to resynchronize with the changed variable.
A form can be saved from within the visual editor; thereafter it can be attached to a menu entry, or another dialog's button. Dialogs are saved in the standard document format, and in a platform
independent way.
And more ...
After this first impression, you may want to consult your documentation for an in-depth coverage of Oberon/F (select the Help item in the Apple menu for an overview over the documentation).